package com.baitengsoft.patentservicemonitor.api.service.impl;

import com.baitengsoft.patentservicemonitor.api.dao.WebPlatformDao;
import com.baitengsoft.patentservicemonitor.api.service.WebPlatformService;
import com.baitengsoft.patentservicemonitor.job.dao.PacPatentinfoDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author wangze
 * @date 2018-03-05 16:37.
 **/
@Service
public class WebPlatformImpl implements WebPlatformService {


    @Resource
    WebPlatformDao webPlatformDao;


    @Resource
    PacPatentinfoDao pacPatentinfoDao;


    @Override
    @Transactional
    public boolean updatePatentNum(int platformId) {
        long count = pacPatentinfoDao.queryTotalByPlatformId(platformId);
        return webPlatformDao.updatePatentNum(platformId, count) > 0;
    }

    @Override
    public String getAreaName(int platformId) {
        return webPlatformDao.getAreaName(platformId);
    }


}
